import { Component, OnInit, ViewChild } from '@angular/core';

@Component({
  selector: 'app-communication',
  templateUrl: './communication.component.html',
  styleUrls: ['./communication.component.less']
})
export class CommunicationComponent implements OnInit {

  @ViewChild('footer') footer: any

  public msg: string = 'communication组件'

  constructor() { }

  ngOnInit(): void {
  }

  // 父组件方法
  run() {
    console.log('父组件的run方法')
  }

  getChildMsgAndFn() {
    console.log('this.footer---', this.footer)
    console.log(this.footer.msg)
    this.footer.run()
  }

  runFooter(e) {
    console.log('e---', e)
  }
}
